package pkg

import (
	"encoding/json"
	"fmt"
	"github.com/Baidu-AIP/golang-sdk/aip/censor"
	"post-hub/internal/model"
)

func Text() {
	var post model.Post
	marshal, err := json.Marshal(&post)
	if err != nil {
		return
	}
	client := censor.NewClient("kF8xf1M3Mzp9CpUrZCfxKbNg", "Kz5PGYOqsdBk90eQcsGa1H9P0QqqtsZ5")
	res := client.TextCensor(string(marshal))
	fmt.Println(res)

}

func Comment() {
	var comment model.Comment
	marshal, err := json.Marshal(&comment)
	if err != nil {
		return
	}
	client := censor.NewClient("kF8xf1M3Mzp9CpUrZCfxKbNg", "Kz5PGYOqsdBk90eQcsGa1H9P0QqqtsZ5")
	res := client.TextCensor(string(marshal))
	fmt.Println(res)

}
